﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>html辅助方法</title>
</head>
<body>
    <div>
        @Html.Partial("_PartialPage1")
        <a href="https://www.baidu.com">html超链接</a>

        <hr />
        <h1>辅助方法生成的</h1>
        @Html.ActionLink("链接名称", "BaiDu");
        <br />
        @Html.ActionLink("链接名称(带参数)", "BaiDu", new { name = "张三", age = 20 });
        <br />
        @Html.ActionLink("链接名称(带前段属性)", null, null, new { href = "https://www.baidu.com", style = "color:red;" });
        <hr />
        @*@{
        Html.BeginForm("Test", "HTMLHelper", FormMethod.Post);
            <input type="text" name="name" value="" />
            <input type="text" name="age" value="" />
            <input type="submit" value="提交" />
        Html.EndForm();
        }*@
        @using (Html.BeginForm("Test", "HTMLHelper", FormMethod.Post))
        {
            <input type="text" name="name" value="" />
            <input type="text" name="age" value="" />
            <input type="submit" value="提交" />
        }

        <hr />
        <h1>姓名：@ViewBag.name   年龄：@ViewBag.age</h1>
        <hr />
        @Html.Partial("_PartialPage1")
    </div>
</body>
</html>
